#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <math.h>

int su(int x)
{
    if (x < 2)
        return 0;
    for (int i = 2; i <= sqrt(x); i++)
    {
        if (x % i == 0)
            return 0;
    }
    return 1;
}

int main() {
    int n = 0, m = 0;
    scanf("%d%d", &n, &m);

    int val = 0;
    for (int i = n; i <= m; i++)
    {
        if (su(i) == 1 && (val += i));
    }
    printf("%d", val);

    return 0;
}